package src.算法.递归;

public class Factorial {
    // 递归求阶乘
    public static int factorial(int i){
        if(i==1 || i==0){
            return 1;
        }
        return i*factorial(i-1);
    }

    public static void main(String[] args) {
        System.out.println("5的阶乘："+factorial(10));
    }
}
